﻿using System;

namespace PluginMediatorSample.Classes
{
    /// <summary>
    /// Simple ViewModel to show how to broadcast a message to all registered ViewModels
    /// </summary>
    public class D : BaseViewModel
    {
        public void SendMessage1(string message)
        {
            SomeData1 data = new SomeData1 { Text = message };
            Mediator.Invoke<Test1Delegate>("message", (action) => action(data));
        }

        public void SendMessage2(int value)
        {
            SomeData2 data = new SomeData2 { Value = value };
            Mediator.Invoke<Test2Delegate>("message", (action) => action(data));
        }
    }
}